home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SNIP9_91.ARJ / CURSOR2.C < prev    next >
Text File  |  1991-08-04  |  1KB  |  30 lines

  1. /*
  2. **  CUESOR.C - hide/unhide the cursor
  3. **
  4. **  by: Gary Chambers
  5. */
  6.  
  7. void cursor(char state)
  8. {
  9.       union REGS regs;
  10.       static int oldstart=0, oldstop=0;
  11.  
  12.       if (state)                       /* Restores cursor               */
  13.       {
  14.             regs.h.ah = 0x01;          /* BIOS Set Cursor Type          */
  15.             regs.h.ch = oldstart;      /* Retrieve starting scan line   */
  16.             regs.h.cl = oldstop;       /* Retrieve ending scan line     */
  17.             int86(0x10, ®s, ®s); /* Call BIOS                     */
  18.       }
  19.       else                             /* Removes cursor                */
  20.       {
  21.             regs.h.ah = 0x03;          /* BIOS Get Cursor Position      */
  22.             int86(0x10, ®s, ®s); /* Call BIOS                     */
  23.             oldstart = regs.h.ch;      /* Save starting scan line       */
  24.             oldstop = regs.h.cl;       /* Save ending scan line         */
  25.             regs.h.ah = 0x01;          /* BIOS Set Cursor Type          */
  26.             regs.h.ch = 0x20;          /* Set bit 5 in CH               */
  27.             int86(0x10, ®s, ®s); /* Call BIOS                     */
  28.       }
  29. }
  30.